<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <title>发布知识列表</title>
    <%@include file="/common/commonCSS.jsp" %>
    <%@include file="/common/commonJS.jsp" %>
    <%@include file="/WEB-INF/jsp/include/taglib.jsp" %>
</head>

<body>
    <div class="main-container" id="main-container">

        <div class="row" style="margin-top: 20px;">
            <div class="col-md-12">
                <form class="layui-form" id="search-from" action="${webRoot}/knowledge/search">
                    <div class="layui-form-item">
                        <%--<label class="layui-form-label" style="width:6%;">标题:</label>--%>
                        <div class="layui-input-inline">
                            <input type="text" name="topic" value="${knowledge.topic}"  placeholder="请输入标题"  class="layui-input" >
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" name="keyWord" value="${knowledge.keyWord}"  placeholder="请输入关键字"  class="layui-input" >
                        </div>
                        <button class="layui-btn" id="searchSubmit"><i class="layui-icon">&#xe615;</i>搜 索</button>
                        <button class="layui-btn layui-btn-normal" type="button" id="refresh"><i class="layui-icon">&#x1005;</i>重 置</button>
                    </div>
                </form>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <table id="table-list" class="layui-table" lay-size="sm">
                    <thead>
                        <tr>
                            <th>序号</th>
                            <th>标题</th>
                            <th>关键字</th>
                            <th>知识类型</th>
                            <%--<th>工单编号</th>--%>
                            <th>业务系统</th>
                            <th>作者</th>
                            <th>创建时间</th>
                            <c:forEach items="${fieldList}" var="firld" varStatus="i">
                                <th>${firld.fieldName}</th>
                            </c:forEach>
                            <th>查看详情</th>

                        </tr>
                    </thead>
                    <tbody>
                        <c:forEach items="${page.result}" var="knowledge" varStatus="i">
                            <tr id="knowledge${knowledge.id }">
                                <td>${i.index+1 }</td>
                                <td>${knowledge.topic}</td>
                                <td>${knowledge.keyWord}</td>
                                <td>${fns:getCodeName("knowledge_type",knowledge.type)}</td>
                                <%--<td>${knowledge.knoNo}</td>--%>
                                <td>${knowledge.operationName}</td>
                                <td>${knowledge.authorUser}</td>
                                <td><fmt:formatDate value="${knowledge.createDate}" pattern="yyyy-MM-dd hh:mm:ss"/></td>
                                <%--<td>${fns:getCodeName("act_result",knowledge.actResult)}</td>--%>
                                <%--<td>${fns:getCodeName("knowledge_status",knowledge.status)}</td>--%>
                                <c:forEach items="${knowledge.valueDictionarys}" var="valueDictionary">
                                    <td>${valueDictionary.fieldValue}</td>
                                </c:forEach>
                                <td>
                                    <div class=" btn-group ">
                                        <button type="button" class="layui-btn layui-btn-small" title="查看" onclick="getView(${knowledge.id})"><i class="layui-icon">&#xe705;</i></button>
                                    </div>
                                </td>
                            </tr>
                        </c:forEach>
                    </tbody>
                </table>
                <sys:page page="${page}"></sys:page>
            </div>
        </div>
    </div>
</body>
<script>
    //知识发布详情弹框
    function getView(id) {
        var url="${webRoot}/knowledge/view?id="+id;
        //弹框层
        layer.open({
            scrollbar: true,
            type: 2,
            title : ["查看知识" , true],
            area: ['65%', '80%'], //宽高
            content: [url],
            shadeClose : false,
        });
    }

</script>

</html>